﻿namespace HiMap.MapControls.Tools.Frm
{
    using HiMap.MapControls;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    internal class FrmXY : Form
    {
        private Button BtnGoto;
        private IContainer components;
        private string FrmXYCaption;
        private string FrmXYMessage1;
        private string FrmXYPosition;
        private string FrmXYXValue;
        private string FrmXYYValue;
        private Label label1;
        private Label label2;
        private MainMenu mainMenu1;
        private TextBox TxtX;
        private TextBox TxtY;
        public double X;
        public double Y;

        public FrmXY()
        {
            this.InitializeComponent();
            this.getText();
            this.Text = this.FrmXYCaption;
            this.label1.Text = this.FrmXYXValue;
            this.label2.Text = this.FrmXYYValue;
            this.BtnGoto.Text = this.FrmXYPosition;
        }

        private void BtnGoto_Click(object sender, EventArgs e)
        {
            if ((this.TxtX.Text.Trim() == "") || (this.TxtY.Text.Trim() == ""))
            {
                MessageBox.Show(this.FrmXYMessage1);
            }
            else
            {
                this.X = Convert.ToDouble(this.TxtX.Text);
                this.Y = Convert.ToDouble(this.TxtY.Text);
                base.Close();
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void getText()
        {
            this.FrmXYMessage1 = Setup.GetInfo("FrmXYMessage1");
            this.FrmXYCaption = Setup.GetInfo("FrmXYCaption");
            this.FrmXYXValue = Setup.GetInfo("FrmXYXValue");
            this.FrmXYYValue = Setup.GetInfo("FrmXYYValue");
            this.FrmXYPosition = Setup.GetInfo("FrmXYPosition");
        }

        private void InitializeComponent()
        {
            this.mainMenu1 = new MainMenu();
            this.label1 = new Label();
            this.label2 = new Label();
            this.TxtX = new TextBox();
            this.TxtY = new TextBox();
            this.BtnGoto = new Button();
            base.SuspendLayout();
            this.label1.Location = new Point(7, 0x20);
            this.label1.Name = "label1";
            this.label1.Size = new Size(100, 20);
            this.label1.Text = "X Value:";
            this.label2.Location = new Point(7, 0x3b);
            this.label2.Name = "label2";
            this.label2.Size = new Size(100, 20);
            this.label2.Text = "Y Value:";
            this.TxtX.Location = new Point(60, 0x1f);
            this.TxtX.Name = "TxtX";
            this.TxtX.Size = new Size(0x9d, 0x15);
            this.TxtX.TabIndex = 3;
            this.TxtY.Location = new Point(60, 0x3a);
            this.TxtY.Name = "TxtY";
            this.TxtY.Size = new Size(0x9d, 0x15);
            this.TxtY.TabIndex = 4;
            this.BtnGoto.Location = new Point(0x91, 0x55);
            this.BtnGoto.Name = "BtnGoto";
            this.BtnGoto.Size = new Size(0x48, 20);
            this.BtnGoto.TabIndex = 5;
            this.BtnGoto.Text = "Position";
            this.BtnGoto.Click += new EventHandler(this.BtnGoto_Click);
            base.set_AutoScaleDimensions(new SizeF(96f, 96f));
            base.set_AutoScaleMode(2);
            this.AutoScroll = true;
            base.ClientSize = new Size(240, 0x10c);
            base.Controls.Add(this.BtnGoto);
            base.Controls.Add(this.TxtY);
            base.Controls.Add(this.TxtX);
            base.Controls.Add(this.label2);
            base.Controls.Add(this.label1);
            base.Menu = this.mainMenu1;
            base.Name = "FrmXY";
            this.Text = "Point Position";
            base.ResumeLayout(false);
        }
    }
}

